
<%@ page import="rentadomus.Contract" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'contract.label', default: 'Contract')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#show-contract" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
				<li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="show-contract" class="content scaffold-show" role="main">
			<h1><g:message code="default.show.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list contract">
			
				<g:if test="${contractInstance?.monthlyRentFee}">
				<li class="fieldcontain">
					<span id="monthlyRentFee-label" class="property-label"><g:message code="contract.monthlyRentFee.label" default="Monthly Rent Fee" /></span>
					
						<span class="property-value" aria-labelledby="monthlyRentFee-label"><g:fieldValue bean="${contractInstance}" field="monthlyRentFee"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${contractInstance?.rentPayDate}">
				<li class="fieldcontain">
					<span id="rentPayDate-label" class="property-label"><g:message code="contract.rentPayDate.label" default="Rent Pay Date" /></span>
					
						<span class="property-value" aria-labelledby="rentPayDate-label"><g:formatDate date="${contractInstance?.rentPayDate}" /></span>
					
				</li>
				</g:if>
			
				<g:if test="${contractInstance?.person}">
				<li class="fieldcontain" style="display:${isMyContract}">
					<span id="person-label" class="property-label"><g:message code="contract.person.label" default="Person" /></span>
					
						<span class="property-value" aria-labelledby="person-label"><g:link controller="person" action="show" id="${contractInstance?.person?.id}">${contractInstance?.person?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
			
				<g:if test="${contractInstance?.place}">
				<li class="fieldcontain">
					<span id="place-label" class="property-label"><g:message code="contract.place.label" default="Place" /></span>
					
						<span class="property-value" aria-labelledby="place-label">${contractInstance?.place?.encodeAsHTML()}</span>
					
				</li>
				</g:if>
			
				<g:if test="${contractInstance?.rules}">
				<li class="fieldcontain">
					<span id="rules-label" class="property-label"><g:message code="contract.rules.label" default="Rules" /></span>
					
						<g:each in="${contractInstance.rules}" var="r">
						<span class="property-value" aria-labelledby="rules-label"><g controller="behaviourRule" action="show" id="${r.id}">${r?.encodeAsHTML()}</g></span>
						</g:each>
					
				</li>
				</g:if>
			
			</ol>
			<g:form style="display:${isMyContract}">
				<fieldset class="buttons">
					<g:hiddenField name="id" value="${contractInstance?.id}" />
					<g:link class="edit" action="edit" id="${contractInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
					<g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
                                        <a class="save" href="${createLink(controller:"behaviourRule", action:'create', id:contractInstance?.id)}">Add Rule<g:message default="AddRule"/></a>
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
